home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / projectLightPanel.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.2 KB  |  173 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  January 12, 1997
  22. //  Author:         Sanjay Bakshi
  23. //
  24. //  Description:
  25. //      This creates a panel that has a projectLightEditor inside
  26. //        of it.
  27. //
  28. //  Input Arguments:
  29. //      None.
  30. //
  31. //  Return Value:
  32. //      None.
  33. //
  34.  
  35.  
  36.  
  37. global proc
  38. createProjectLightPanel (string $whichPanel)
  39. //
  40. //  Description:
  41. //        Define the editors that are used in this panel.  No
  42. //        controls (widgets) are created at this point.
  43. //
  44. {
  45.     //  create unique names for editors based on panel name
  46.     //
  47.     string $projectLightEd = ($whichPanel + "ProjectLightEd");
  48.     projectLightEditor
  49.         -unParent
  50.         $projectLightEd;
  51. }
  52.  
  53.  
  54.  
  55.  
  56. global proc
  57. addProjectLightPanel (string $whichPanel)
  58. //
  59. //  Description:
  60. //        Add the panel to a layout.
  61. //        Parent the editors to that layout and create any other
  62. //        controls (widgets) required.
  63. //
  64. {
  65.     string $projectLightEd = ($whichPanel + "ProjectLightEd");
  66.  
  67.     waitCursor -state on;
  68.  
  69.     formLayout baseForm;
  70.     setParent baseForm;
  71.  
  72.     frameLayout 
  73.         -visible true 
  74.         -borderVisible false
  75.         -labelVisible false 
  76.         -collapsable false 
  77.         -collapse true
  78.         projLightFrame;
  79.  
  80. //    paneLayout -configuration "vertical2" -ps 1 35 100 projLightPane;
  81.  
  82.     columnLayout pane1;
  83. //    setParent projLightPane;
  84. //    formLayout pane2;
  85.  
  86. //    setParent pane1;
  87.     projLightUI $projectLightEd;
  88.  
  89. //    setParent pane2;    
  90. //    modelEditor -cam persp;
  91.  
  92.  
  93.     waitCursor -state off;
  94. }
  95.  
  96. global proc
  97. removeProjectLightPanel (string $whichPanel)
  98. //
  99. //  Description:
  100. //        Remove the panel from a layout.
  101. //        Delete controls.
  102. //
  103. {
  104.     string $projectLightEd = ($whichPanel + "ProjectLightEd");
  105.  
  106.     if (`projectLightEditor -exists $projectLightEd`) {
  107.         projectLightEditor -edit -unParent $projectLightEd;
  108.     }
  109. }
  110.  
  111. global proc
  112. deleteProjectLightPanel (string $whichPanel)
  113. //
  114. //  Description:
  115. //        This proc will delete the contents of the panel, but not
  116. //        the panel itself.
  117. //
  118. //  Note:
  119. //        We only need to delete editors here.  Other UI will be taken care of
  120. //        by the remove proc.
  121. //
  122. {
  123.     string $projectLightEd = ($whichPanel + "ProjectLightEd");
  124.  
  125.     if (`projectLightEditor -exists $projectLightEd`) {
  126.         deleteUI -editor $projectLightEd;
  127.     }
  128. }
  129.  
  130. global proc string
  131. saveStateProjectLightPanel (string $whichPanel)
  132. //
  133. //  Description:
  134. //        This proc returns a string that when executed will restore the
  135. //        current state of the panel elements.
  136. //
  137. {
  138.     string $projectLightEd = ($whichPanel + "ProjectLightEd");
  139.  
  140.     return (
  141.         `projectLightEditor -query -stateString $projectLightEd`
  142.     );
  143. }
  144.  
  145. global proc
  146. projectLightPanel (string $panelName)
  147. //
  148. //  Description:
  149. //        Create a new scripted fullGraphPanel.  If the scripted
  150. //        panel hasn't yet been defined then define it.
  151. //
  152. {
  153.     global string $gMainPane;
  154.  
  155.     if (!`scriptedPanelType -exists projectLightPanel`) {
  156.         //
  157.         //  Define the callbacks for the fullGraphPanel
  158.         //
  159.         scriptedPanelType
  160.             -createCallback        "createProjectLightPanel" 
  161.             -addCallback        "addProjectLightPanel"
  162.             -removeCallback        "removeProjectLightPanel"
  163.             -deleteCallback        "deleteProjectLightPanel"
  164.             -saveStateCallback    "saveStateProjectLightPanel"
  165.             projectLightPanel;
  166.     }
  167.  
  168.     //  instantiate a new fullGraphPanel
  169.     //
  170.     setParent $gMainPane;
  171.     scriptedPanel -unParent -type projectLightPanel $panelName;
  172. }
  173.